<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // 写一个函数，实现反转任意数组。
        function a (arr) {
            var newArr = []
            for (i = arr.length - 1; i >= 0; i--) {
                newArr[newArr.length] = arr[i]
            }
            return newArr
        }
        var arr1 = a([5 , 4 , 8, 9, 7])
        console.log(arr1);
    </script>
</body>
</html>